import React, { Component } from 'react';
import { Link, withRouter } from 'react-router-dom';
import Index from '../router1/Index';
class Father extends Component {
    state = {
        id: 100,
        id1: 99
    }
    render() {
        return (
            // 声明式导航
            <>
                <p>
                    <Link to='/home'>首页</Link>
                    <Link to={`/category/${this.state.id}/${this.state.id1}`}>分类</Link>
                    <Link to={{
                        pathname: '/car',
                        state: { // 隐式传参 用来进行页面埋点
                            id: this.state.id,
                            id1: this.state.id1
                        }
                    }}>购物车</Link>
                    <Link to='/mine'>我的</Link>
                </p>
                {/* 路由规则 */}
                <Index></Index>
            </>
        )
    }
}

export default Father